/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package generator;

/**
 *
 * @author abosancic
 */
public class SQLiteTypeMap {

  
  /**
   * Translates a data type from an integer (java.sql.Types value) to a string
   * that represents the corresponding class.
   * 
   * @param type The java.sql.Types value to convert to a string representation.
   * @return The class name that corresponds to the given java.sql.Types value,
   *         or "java.lang.Object" if the type has no known mapping.
   */
  public static String convert( String type ) {
      
      String result = "java.lang.Object";
       
      switch (type) {
          case "CHAR":
          case "TEXT":
          case "VARCHAR":    
              result = "java.lang.String";
              break;

          case "INTEGER":
          case "NUMERIC":
              result = "java.lang.Integer";
              break;
              
          case "BIT":
              result = "java.lang.Byte";
              break;
              
          case "DATE":
              result = "java.util.Date";
              break;
              
              
      }
      
      return result;
  }
  
}
